/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Business;

import DataAccess.EventDataAccess;
import Entities.EventEntities;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author vjphl
 */
@ManagedBean
@RequestScoped
public class DemoBean {

    
    List<EventEntities> eventList;


    EventEntities eventEntities;
    /**
     * Creates a new instance of DemoBean
     */
    public DemoBean() {
        eventList = new ArrayList<EventEntities>();
        eventEntities = new EventEntities();
        AllEventbyId();
    }
    
    public String AllEventbyId() {
        //String CatId = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("CatId");
        try {
            EventDataAccess eventDataAccess = new EventDataAccess();
            
            eventList = eventDataAccess.getEventAll();
        } catch (Exception ex) {
            Logger.getLogger(EventBean.class.getName()).log(Level.SEVERE, null, ex);
        }
        return "LoadCatId";
    }
    
    public List<EventEntities> getEventList() {
        return eventList;
    }

    public void setEventList(List<EventEntities> eventList) {
        this.eventList = eventList;
    }
    
    public EventEntities getEventEntities() {
        return eventEntities;
    }

    public void setEventEntities(EventEntities eventEntities) {
        this.eventEntities = eventEntities;
    }
}
